// array_find_demo.js

const arr = [1, 2, 20, 10, 11, 40, 45, 60]

let target = arr.find(item => item > 10)
console.log(target); // 20 , 输出找到的第一个满足条件的元素

console.log(arr.find(ele => ele > 100)); // undefined , 不满足条件输出 `undefined`

const objArr = [
    {name: '华为', inventory: 20, price: 2000},
    {name: '小米', inventory: 30, price: 3200}
];
target = objArr.find(item => item.name=='华为');
console.log(target);
target.inventory = 19
console.log(target);
console.log(objArr);


